home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr25 / defrago.zip / DEFRAG.TXT
Text File  |  1993-03-01  |  11KB  |  226 lines

  1.      How to Defrag FAT Volumes After Installing OS/2 (Any Version)
  2.  
  3.                   Address Comments/Suggestions to:
  4.                       Mercer Harz, 70431,150
  5.  
  6. All standard disclaimers apply; this procedure works for me, and
  7. others, and I've never had to resort to use of the backup I make.
  8. However, disaster can strike at any time; be prepared.  Although I have
  9. followed these directions (more or less) on a regular basis when
  10. defragging my systems, and have not experienced any problems as a result,
  11. (under OS/2 v1.2, 1.3, and 2.0, and DOS 4.01 and 5.0), you should still
  12. be careful.  In particular, attempt to run the defragger with as few
  13. device drivers loaded as possible (preferably none); no programs that
  14. terminate and stay resident (TSRs); no disk caching software; no extended
  15. memory managers; etc.  The safest way to run a defragger is to make
  16. sure that only DOS and the defragging software are executing.
  17.  
  18. The instructions below assume that you are using OS/2 2.0 and DOS 5.0.
  19. If you are using different versions of these operating systems, the
  20. procedures in general are still valid, but the particular details
  21. concerning file locations, file names and capabilities of the ATTRIB
  22. program may vary.
  23.  
  24. Currently, there is no support under OS/2 for Stacker or similar
  25. on-the-fly disk compression systems.  This procedure has not been tested
  26. on STACKed volumes; it is very unlikely that, as written, it will work
  27. properly on them.  When an OS/2 version of STACKER is available, and I
  28. get it <g>, I'll update this procedure as required.
  29.  
  30. *---------------------------------------------------------------------*
  31.  
  32. Requirements:
  33.  
  34.  1. The target volume(s) must be formatted for the FAT file system.
  35.  
  36.  2. You must have a bootable DOS diskette (preferably 4.01 or later).
  37.     The CONFIG.SYS and AUTOEXEC.BAT for this boot diskette should
  38.     be as simple as possible; don't load any TSRs, cache programs,
  39.     memory managers, or device drivers (beyond those required for
  40.     hard disk access, if any).
  41.  
  42.  3. You must have a disk defragger (optimizer) that preserves the
  43.     entire directory entry for a file.  There are reserved bytes in
  44.     each entry of a FAT-formatted directory; these are used to store
  45.     pointers to extended attributes.  A few older programs did not
  46.     preserve the contents of these reserved bytes when manipulating
  47.     directory entries.  I've used SoftLogic Systems' "Disk Optimzer"
  48.     (v4.01 and later) and Norton's "Speedisk" (v4.5 and later)
  49.     successfully.  Other products are likely to work successfully as
  50.     well.  You can run the defragger from the disk being defragged, from
  51.     another FAT-format hard disk volume, or, if you copy the defragger
  52.     onto the bootable DOS diskette, from the diskette.
  53.  
  54.  4. You must have the OS/2 2.0 Installation diskette, as well as
  55.     diskettes 1 and 2.
  56.  
  57.  5. You must have a DOS utility, such as ATTRIB, or a disk editor, such
  58.     as Norton's DiskEdit, with which you can change the file attributes
  59.     of OS/2 system files that are to be defragged.  This utility must be
  60.     available on the bootable DOS diskette, or in a directory on a hard
  61.     disk volume.  Alternatively, you could perform the ATTRIB steps
  62.     described below while booted from the OS/2 installation diskettes,
  63.     by making explicit references to x:\OS2\ATTRIB.EXE, where x: is
  64.     the hard disk volume on which OS/2 2.0 is installed.  If you need
  65.     directions for the use of the ATTRIB command, refer to the online
  66.     OS/2 Command Reference, in the Information folder.  Its syntax
  67.     description is valid for both DOS (5.0) and OS/2.
  68.  
  69. *---------------------------------------------------------------------*
  70.  
  71. Procedure:
  72.  
  73.  0. Take a full backup of all volumes that you are going to defrag.
  74.     If you have an OS/2 backup program, all the better; it will handle
  75.     backing up and restoring extended attributes automatically.  If you
  76.     have a DOS backup program, look in the libraries in IBMOS2 for
  77.     one of the utilities that allow you to backup and restore the
  78.     OS/2 extended attributes using DOS backup software.  EABK10.ZIP
  79.     and EAPREP.CMD are two that I know of (I wrote the latter).  Also,
  80.     there is another program that saves the WorkPlace Shell configuration;
  81.     it is called WPSBK2.ZIP; highly recommended, regardless of the type
  82.     of backup software you have.
  83.  
  84.  1. Shutdown OS/2 (click the right mouse button on the desktop, then
  85.     select "Shut down" from the popup menu).
  86.  
  87.  2. When you see the message informing you that you can either press
  88.     CTRL+ALT+DEL or turn off the machine, insert the OS/2 2.0
  89.     Installation Diskette in drive A:, then press CTRL+ALT+DEL.
  90.  
  91.  3. When prompted, insert OS/2 2.0 diskette 1.  A little while after the
  92.     OS/2 logo is displayed, you will be asked to press ESC to cancel or
  93.     ENTER to continue with installation.
  94.  
  95.  4. Press ESC.  You will then be dropped out of installation, to an
  96.     OS/2 command-line prompt, logged onto drive A:.
  97.  
  98.  5. Insert OS/2 2.0 diskette 2, which contains CHKDSK.
  99.  
  100.  6. Run CHKDSK /F against every volume that you are going to defrag,
  101.     while still logged onto the A: drive.
  102.  
  103.     Example:  If you are going to defrag volumes C:, E: and F:, issue
  104.               the following commands, from the [A:]> prompt:
  105.  
  106.                   CHKDSK C: /F
  107.                   CHKDSK E: /F
  108.                   CHKDSK F: /F
  109.  
  110.     This is necessary, so that there are no errors in the Extended
  111.     Attribute (EA) pointers prior to the defrag, and to reclaim space
  112.     from EAs that have been deleted.
  113.  
  114.     The reason you boot from floppy to do this is that CHKDSK cannot
  115.     fix disk errors on the disk that it is booted from, because of
  116.     system integrity issues.
  117.  
  118.  7. At this point, the faint at heart may want to re-boot OS/2 2.0
  119.     from the hard disk, just to make sure that everything still works,
  120.     particularly if errors were found during the CHKDSK execution(s).
  121.     If OS/2 won't reboot from the hard disk, DO NOT proceed to the
  122.     next step; instead, seek assistance, and/or restore your hard
  123.     disk from the backup.  If you successfully reboot OS/2 from the hard
  124.     disk at this point, shutdown again as described in step 1 before
  125.     continuing with the next step.
  126.  
  127.  8. Insert the DOS boot diskette into drive A: and press CTRL+ALT+DEL
  128.     to boot into DOS; do not, under any circumstances, try to run a
  129.     disk defragger/optimizer in a DOS session, either emulated or
  130.     specific, under OS/2 (or Windows, for that matter).  A defragger
  131.     should always run only under native DOS.
  132.  
  133.  9. If you are defragging the volume that contains SWAPPER.DAT, delete
  134.     the SWAPPER.DAT file.  (The drive and directory containing
  135.     SWAPPER.DAT is specified by the SWAPPATH entry in the OS/2
  136.     CONFIG.SYS.) Deleting SWAPPER.DAT prior to defragging has two
  137.     benefits:  it shortens the defrag time, and, since SWAPPER.DAT is
  138.     deleted and reallocated at every bootup, it will ensure that the page
  139.     dataset is usually contiguous and located at the "end" of the drive.
  140.  
  141. 10. If you are defragging a volume containing a Windows 3.0 or 3.1
  142.     SWAPFILE (386SPART.PAR), leave this file alone.  Do not unhide
  143.     or delete it.  Windows allocates this file contiguously; it
  144.     never needs to be defragged.  Of course, there is an exception:
  145.     should you need to enlarge the Windows SWAPFILE, use the Windows
  146.     SWAPFILE program (Win3.0) or the 386 Enhanced Mode Control Panel
  147.     applet (Win3.1) to delete the current 386SPART.PAR prior to
  148.     running the defrag procedure, then, after defragging, use the
  149.     Windows tool to allocate the larger Windows SWAPFILE.
  150.  
  151. 11. Invoke ATTRIB (or use a disk editor) to clear the HIDDEN, SYSTEM
  152.     and/or READ-ONLY attributes of the following files:
  153.  
  154.     On the OS/2 2.0 boot volume (if formatted for FAT):
  155.  
  156.       File Name                      Normal Attrs
  157.       -----------------------------  ------------
  158.       x:\EA DATA. SF                 Hid R-O Sys
  159.       x:\WP ROOT. SF                 Hid     Sys
  160.       x:\OS2LDR                      Hid R-O Sys
  161.       x:\OS2KRNL                     Hid R-O Sys
  162.       x:\OS2BOOT                     Hid R-O Sys
  163.     * x:\IBMLVL.INI                      R-O
  164.       x:\OS2\BITMAP\AAAAA.EXE        Hid     Sys
  165.       x:\OS2\BITMAP\AAAAA.MET        Hid     Sys
  166.    ** x:\OS2\SYSTEM\BOOT.OS2         Hid R-O
  167.       (plus any other hidden files you want to defrag)
  168.  
  169.       * Present only if you have installed Extended Services v1.0
  170.      ** Present only if you have installed for DualBoot
  171.  
  172.     On all other FAT volumes:
  173.  
  174.       x:\EA DATA. SF                 Hid R-O Sys
  175.       x:\WP ROOT. SF                 Hid     Sys
  176.       (plus any other hidden files you want to defrag)
  177.  
  178.     Depending on other products you may have installed, there may be
  179.     other hidden files that you may want to unhide, so that they can
  180.     be defragged, relocated, or both.
  181.  
  182. 12. To manipulate the files that have spaces embedded in their names,
  183.     use DOS wildcards, such as the following example, which will clear
  184.     all the file attributes for these files:
  185.  
  186.           ATTRIB -H -R -S x:\*.?SF
  187.  
  188.     This example resets the file attributes for the WP ROOT. SF file:
  189.  
  190.           ATTRIB +H +S x:\WP?ROOT.?SF
  191.  
  192. 13. If you are set up for DualBoot, and are defragging the boot disk,
  193.     DO NOT unhide the DOS system files.  Some versions of DOS are not
  194.     sensitive to the location of the system files, but others require
  195.     the system files to be located directly behind the root directory,
  196.     where they are normally placed when DOS formats the hard disk
  197.     and makes it bootable.  The files are usually named as follows:
  198.  
  199.        x:\IBMBIO.COM and x:\IBMDOS.COM    (for IBM PC-DOS)
  200.        x:\IO.SYS and x:\MSDOS.SYS         (for MS-DOS)
  201.  
  202.     If you unhide these files and the defragger relocates them, depending
  203.     on the version and/or DOS vendor, you may be unable to boot DOS from
  204.     the hard disk any longer; fixing this problem usually requires
  205.     reformatting.  OS/2 booting will be unaffected, and DOS itself can
  206.     still be booted from floppy, then run off the hard drive.  But it
  207.     is safer not to move these files.
  208.  
  209.     OS/2 1.3 and 2.0 system files are not position-dependent.  They can
  210.     be located anywhere on the boot volume; OS/2 uses directory entries
  211.     to locate these files.
  212.  
  213. 14. Defrag the disk(s).  When using Speedisk, I usually opt for full
  214.     optimization with file/directory reordering, not just defragging.
  215.  
  216. 15. When the defragging is complete, you can (if you want to) use ATTRIB
  217.     or a disk editor to reset the file attributes you changed in step 11
  218.     back to their original values.  This is not necessary, however.
  219.  
  220. 16. Remove the bootable DOS diskette from drive A: and press CTRL+ALT+DEL
  221.     to reboot into OS/2 v2.0.
  222.  
  223. 17. You are done.
  224.  
  225. =========================== END OF DOCUMENT ============================
  226.